import 'package:enterprise_v6_app/generated/json/base/json_convert_content.dart';
import 'package:enterprise_v6_app/app/data/entities/double_control/get_count_entity.dart';

GetCountEntity $GetCountEntityFromJson(Map<String, dynamic> json) {
  final GetCountEntity getCountEntity = GetCountEntity();
  final int? pendingCount = jsonConvert.convert<int>(json['pendingCount']);
  if (pendingCount != null) {
    getCountEntity.pendingCount = pendingCount;
  }
  final int? pendingGeneralCount = jsonConvert.convert<int>(json['pendingGeneralCount']);
  if (pendingGeneralCount != null) {
    getCountEntity.pendingGeneralCount = pendingGeneralCount;
  }
  final int? pendingMajorCount = jsonConvert.convert<int>(json['pendingMajorCount']);
  if (pendingMajorCount != null) {
    getCountEntity.pendingMajorCount = pendingMajorCount;
  }
  final int? todayCount = jsonConvert.convert<int>(json['todayCount']);
  if (todayCount != null) {
    getCountEntity.todayCount = todayCount;
  }
  final int? todayGeneralCount = jsonConvert.convert<int>(json['todayGeneralCount']);
  if (todayGeneralCount != null) {
    getCountEntity.todayGeneralCount = todayGeneralCount;
  }
  final int? todayMajorCount = jsonConvert.convert<int>(json['todayMajorCount']);
  if (todayMajorCount != null) {
    getCountEntity.todayMajorCount = todayMajorCount;
  }
  final int? overdueCount = jsonConvert.convert<int>(json['overdueCount']);
  if (overdueCount != null) {
    getCountEntity.overdueCount = overdueCount;
  }
  final int? overdueGeneralCount = jsonConvert.convert<int>(json['overdueGeneralCount']);
  if (overdueGeneralCount != null) {
    getCountEntity.overdueGeneralCount = overdueGeneralCount;
  }
  final int? overdueMajorCount = jsonConvert.convert<int>(json['overdueMajorCount']);
  if (overdueMajorCount != null) {
    getCountEntity.overdueMajorCount = overdueMajorCount;
  }
  return getCountEntity;
}

Map<String, dynamic> $GetCountEntityToJson(GetCountEntity entity) {
  final Map<String, dynamic> data = <String, dynamic>{};
  data['pendingCount'] = entity.pendingCount;
  data['pendingGeneralCount'] = entity.pendingGeneralCount;
  data['pendingMajorCount'] = entity.pendingMajorCount;
  data['todayCount'] = entity.todayCount;
  data['todayGeneralCount'] = entity.todayGeneralCount;
  data['todayMajorCount'] = entity.todayMajorCount;
  data['overdueCount'] = entity.overdueCount;
  data['overdueGeneralCount'] = entity.overdueGeneralCount;
  data['overdueMajorCount'] = entity.overdueMajorCount;
  return data;
}

extension GetCountEntityExtension on GetCountEntity {
  GetCountEntity copyWith({
    int? pendingCount,
    int? pendingGeneralCount,
    int? pendingMajorCount,
    int? todayCount,
    int? todayGeneralCount,
    int? todayMajorCount,
    int? overdueCount,
    int? overdueGeneralCount,
    int? overdueMajorCount,
  }) {
    return GetCountEntity()
      ..pendingCount = pendingCount ?? this.pendingCount
      ..pendingGeneralCount = pendingGeneralCount ?? this.pendingGeneralCount
      ..pendingMajorCount = pendingMajorCount ?? this.pendingMajorCount
      ..todayCount = todayCount ?? this.todayCount
      ..todayGeneralCount = todayGeneralCount ?? this.todayGeneralCount
      ..todayMajorCount = todayMajorCount ?? this.todayMajorCount
      ..overdueCount = overdueCount ?? this.overdueCount
      ..overdueGeneralCount = overdueGeneralCount ?? this.overdueGeneralCount
      ..overdueMajorCount = overdueMajorCount ?? this.overdueMajorCount;
  }
}
